A good answer might be:

The program runs. However, it is not clear what negative values mean in this situation. The program could be improved by calling the user's attention to possibly erroneous data.


Insulated Wall Problem

To meet building code requirements, outside walls of new houses must be highly insulated. Say that the building code requires outside walls to be insulated with at least 4 inches of fiber glass batting or with at least 3 inches of plastic foam insulation.

Here is a program that asks for the number of inches of fiber and the number of inches of foam and determines if a new house meets the building code.

import java.io.*;
class HotHouse
{
  public static void main (String[] args) throws IOException
  { 
    BufferedReader stdin = 
        new BufferedReader ( new InputStreamReader( System.in ) );
 
    String inData;
    int    fiber, foam ; 

    // get the cash
    System.out.println("How much fiber?");
    inData   = stdin.readLine();
    fiber    = Integer.parseInt( inData ); 

    // get the credit line
    System.out.println("How much foam?");
    inData   = stdin.readLine();
    foam     = Integer.parseInt( inData ); 

    // check that at least one requirement is met
    if ( ______________ || ______________ )
      System.out.println("House passes the code requirements!" );
    else
      System.out.println("House fails." );

  }
}


QUESTION 19:

Fill in the blanks so that the program works correctly.